<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>${param.pageTitle }</title>
		<jsp:include page="inc/css.jsp"></jsp:include>
		<jsp:include page="inc/js.jsp"></jsp:include>
		<jsp:include page="inc/xheditor.jsp"></jsp:include>
		<script type="text/javascript">
	$(document).ready(function() {
		$.get("getSelect.do", {
			type : '0'
		}, function(data) {
			$("select#married").append(data);
		});
		$.get("getSelect.do", {
			type : '2'
		}, function(data) {
			$("select#sex").append(data);
		});
		$.get("getSelect.do", {
			type : '1',
			code : null
		}, function(data) {
			$("select#region_treeCode").append(data);
		});
		$.get("getSelect.do", {
			type : '3'
		}, function(data) {
			$("select#degree").append(data);
		});
		$.get("getSelect.do", {
			type : '4'
		}, function(data) {
			$("select#nation").append(data);
		});
		$.get("getSelect.do", {
			type : '5'
		}, function(data) {
			$("select#workType").append(data);
		});
		$.get("getSelect.do", {
			type : '7',
			code : null
		}, function(data) {
			$("select#major").append(data);
		});
		$.get("getSelect.do", {
			type : 'zw',
			code : null
		}, function(data) {
			$("select#position").append(data);
		});
		$("#reg").button().click(function() {
			
			if ($("#loginName").val() == '') {
				alert('请输入用户名！');
				return false;
			}
			if ($("#realName").val() == '') {
				alert('请输入真实姓名！');
				return false;
			}
			if ($("#pwd").val() == '') {
				alert('请输入密码！');
				return false;
			}
			if ($("#pwd1").val() == '') {
				alert('请输入确认密码！');
				return false;
			}
			if ($("#pwd1").val() != $("#pwd").val()) {
				alert('两次输入的密码不相同！');
				return false;
			}
			if ($("#code").val() == '') {
				alert('请输入验证码！');
				return false;
			}
			$('#f').ajaxForm(function(data) {
        		 alert(data); 
    		 }); 
		});
		$("#close").button().click(function() {
			window.close();
		});
		$("#file").button().click(function() {
		});
		$("#check_loginName").button().click(function() {
			check();
		});
	});
	function check(){
		if ($("#loginName").val() == '') {
				alert('请输入用户名！');
				return false;
			}
		$.get("checkUserLoginName.do", {loginName :$("#loginName").val()}, function(data) {
				alert(data);
		});
	}
</script>
	</head>
	<body>
		<jsp:include page="head.jsp"></jsp:include>
		<div class="container">
			<div class="header"></div>
			<div class="mainContent">
				<div class="content">
					<div class="list">
						<form action="./regUser.do" id="f" method="post">
							<fieldset>
								<legend>
									基本信息
								</legend>
								<div>
									<label>
										用户名
									</label>
									<input type="text" id="loginName" name="loginName" onblur="check()"> * <input type="button" id="check_loginName" value="检查是否存在"/>
								</div>
								<div>
									<label>
										真实姓名
									</label>
									<input type="text" id="realName" name="realName"> *
								</div>
								<div>
									<label>
										密 码
									</label>
									<input type="password" id="pwd" name="pwd"> *
								</div>
								<div>
									<label>
										确认密码
									</label>
									<input type="password" id="pwd1" name="pwd1"> *
								</div>
								<div>
									<label>
										年龄
									</label>
									<input type="text" name="age" class="short" value="0">
								</div>
								<div>
									<label>
										身高
									</label>
									<input type="text" name="height" class="short" value="0">
									cm
								</div>
								<div>
									<label>
										性别
									</label>
									<select id="sex" name="sex">
										<option value="">
											请选择
										</option>
									</select>
								</div>
								<div>
									<label>
										民族
									</label>
									<select id="nation" name="nation">
										<option value="">
											请选择
										</option>
									</select>
								</div>
								<div>
									<label>
										学历
									</label>
									<select id="degree" name="degree">
										<option value="">
											请选择
										</option>
									</select>
								</div>
								<div>
									<label>
										是否结婚
									</label>
									<select id="married" name="married">
										<option value="">
											请选择
										</option>
									</select>
								</div>
								<div>
									<label>
										照片
									</label>
									<input type="text" name="pic" class="long">
									<button id="file">
										上传
									</button>
								</div>
								<div>
									<label>
										地区
									</label>
									<select id="region_treeCode" name="region_treeCode">
										<option value="">
											请选择
										</option>
									</select>
								</div>
							</fieldset>
							<fieldset>
								<legend>
									教育背景
								</legend>
								<div>
									<label>
										学校
									</label>
									<input type="text" name="school">
								</div>
								<div>
									<label>
										专业
									</label>
									<select id="major" name="major">
										<option value="">
											请选择
										</option>
									</select>
								</div>
							</fieldset>
							<fieldset>
								<legend>
									工作情况
								</legend>
								<div>
									<label>
										工作年限
									</label>
									<input type="text" name="workYear" value="0" class="short" >
								</div>
								<div>
									<label>
										职位
									</label>
									<select id="position" name="position">
										<option value="">
											请选择
										</option>
									</select>
								</div>
							</fieldset>
							<fieldset>
								<legend>
									求职意向
								</legend>
								<div>
									<label>
										期望工资
									</label>
									<input type="text" name="wages" class="short">
									元
								</div>
								<div>
									<label>
										兼职/全职
									</label>
									<select id="workType" name="workType">
										<option value="">
											请选择
										</option>
									</select>
								</div>
							</fieldset>
							<fieldset>
								<legend>
									联系方式
								</legend>
								<div>
									<label>
										电话
									</label>
									<input type="text" name="tel">
								</div>
								<div>
									<label>
										手机
									</label>
									<input type="text" name="phone">
								</div>
								<div>
									<label>
										QQ
									</label>
									<input type="text" name="qq">
								</div>
								<div>
									<label>
										E-mail
									</label>
									<input type="text" name="email">
								</div>
								<div>
									<label>
										地址
									</label>
									<input type="text" name="address" class="long">
								</div>
								<div>
									<label>
										个人说明
									</label>
									<textarea name="summary" style="width: 500px;height:300px;" class="xheditor-mini"></textarea>
								</div>
								<div>
									<label>
										输入验证码
									</label>
									<input type="text" name="code" id="code" style="width: 30px;"> 
									<img style="margin: 0; border: 0; cursor: hand" title="点击切换图片"
										align="top" src="getCodeImg" onClick="codeImg(this);" /> 
								</div>
							</fieldset>
							<center>
							<button id="reg">
								注册
							</button>
							<button id="close">
								关闭
							</button>
						</center>
						</form>
						
					</div>
				</div>
				<div class="sidebar"></div>
			</div>
			<div class="footer"><jsp:include page="foot.jsp"></jsp:include></div>
		</div>
	</body>
</html>